<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all"/>
    <script src="/layuiadmin/layui/layui.js"></script>
</head>
<body style="background-color:#fff">

<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="" class="layui-form layui-form-pane" lay-filter="layui-form-pane" id="sbumitForm">
            <table class="layui-table layui-form" style="table-layout:fixed">
                <thead>
                <tr>
                    <th style="width:18%;text-align:center;" >选项</th>
                    <th style="text-align:center;width:32%;" >标题</th>
                    <th style="text-align:center;font-size: 13px">描述</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td style="text-align: right">坐骑</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="mount_title"  placeholder="坐骑标题" autocomplete="off" class="layui-input" value="{$model->mount_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="mount_description"  placeholder="坐骑描述" autocomplete="off" class="layui-input" value="{$model->mount_description}"/>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">优惠</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="promo_title"  placeholder="优惠标题" autocomplete="off" class="layui-input" value="{$model->promo_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="promo_description"  placeholder="优惠描述" autocomplete="off" class="layui-input" value="{$model->promo_description}"/>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right">万众瞩目</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="prop_title"  placeholder="标题" autocomplete="off" class="layui-input" value="{$model->prop_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="prop_description"  placeholder="描述" autocomplete="off" class="layui-input" value="{$model->prop_description}"/>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right">客服</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="vip_service_title"  placeholder="标题" autocomplete="off" class="layui-input" value="{$model->vip_service_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="vip_service_description"  placeholder="描述" autocomplete="off" class="layui-input" value="{$model->vip_service_description}"/>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right">发言</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="speak_title"  placeholder="标题" autocomplete="off" class="layui-input" value="{$model->speak_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="speak_description"  placeholder="描述" autocomplete="off" class="layui-input" value="{$model->speak_description}"/>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right">禁言</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="prevent_ban_title"  placeholder="标题" autocomplete="off" class="layui-input" value="{$model->prevent_ban_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="prevent_ban_description"  placeholder="描述" autocomplete="off" class="layui-input" value="{$model->prevent_ban_description}"/>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right">贵宾席</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="vip_seat_title"  placeholder="标题" autocomplete="off" class="layui-input" value="{$model->vip_seat_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="vip_seat_description"  placeholder="描述" autocomplete="off" class="layui-input" value="{$model->vip_seat_description}"/>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right">表情</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="sticker_title"  placeholder="标题" autocomplete="off" class="layui-input" value="{$model->sticker_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="sticker_description"  placeholder="描述" autocomplete="off" class="layui-input" value="{$model->sticker_description}"/>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right">礼物</td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="gift_title"  placeholder="标题" autocomplete="off" class="layui-input" value="{$model->gift_title}"/>
                    </td>
                    <td style="padding: 0px 0px;">
                        <input type="text" name="gift_description"  placeholder="描述" autocomplete="off" class="layui-input" value="{$model->gift_description}"/>
                    </td>
                </tr>
                </tbody>
            </table>

            <div class="layui-form-item" style="margin-top: 15px">
                <div class="layui-input-block">
                    <span class="layui-btn"  onclick="submitForm()" style="width: 100%">确认修改</span>
                </div>
            </div>
        </form>
    </div>
</div>

<script>

    layui.use(['form'], function () {
        $ = layui.jquery;
        var form = layui.form, layer = layui.layer;
    });

    function submitForm() {
        layer.confirm('确认要修改吗？', {icon: 6}, function () {
            $.ajax({
                type: "POST", //请求方式
                url: '/admin/noble/copywriting?noble_id={$model->noble_id}', //请求地址
                dataType: "json", //返回的数据类型
                data: $("#sbumitForm").serialize(), //数据
                //请求成功
                success: function (data) {
                    if (data.code == 0) {
                        layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    } else {
                        layer.msg(data.msg, {icon: 2, time: 5000}, function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    }
                },
                //请求失败
                error: function (e) {
                    if (e.responseJSON.msg) {
                        layer.msg(e.responseJSON.msg, {icon: 2});
                    }
                }
            });
        });
    }
</script>
</body>

</html>
